package edu.java.lectures.lec05.polimorphism;

public class ScaleneTriangle extends IsoscelesTriangle {

    // --- Instance Variables --------------------------------------------------

    static String test="test !!!";
    double c;
    
    // --- Static block --------------------------------------------------------
    static{
	System.out.println("static block - ScaleneTriangle");
    }
    
    // Dynamic block -----------------------------------------------------------
    {
	System.out.println("dynamic block - ScaleneTriangle");
    }

    // --- Constructors --------------------------------------------------------
    public ScaleneTriangle() {
	
	System.out.println("Default constructor ScaleneTriangle");
    }

    public ScaleneTriangle(double a, double b, double c) {
//	super();
	this();
	this.a = a;
	this.b = b;
	this.c = c;
	System.out.println("Constructor ScaleneTriangle");
    }

    // --- Getters and Setters -------------------------------------------------
    public double getC() {
	return c;
    }

    public void setC(double c) {
	this.c = c;
    }

    // --- Methods -------------------------------------------------------------

    // overriding the necessary methods from the super class

    @Override
    public double calculatePerimeter() {
	return a + b + c;
    }

    @Override
    public double calculateSurface() {
	double semiP = calculatePerimeter() / 2;
	return Math.sqrt(semiP * (semiP - a) * (semiP - b) * (semiP - c));
    }

    @Override
    public String toString() {

	// test 1
	// System.out.println(super.toString());

	// test 2
	// System.out.println(getA());
	// System.out.println(this.getA());
	// System.out.println(super.getA());

	return "(" + a + ", " + b + ", " + c + ")";
    }

    // overloading
    public String toString(String printMessage) {
	return "Message: " + printMessage;
    }

    public void executeMeIfYouCan() {
	System.out.println("Raznostranen tr: execute me if you can method.");
    }
    
    public static void test(){
	System.out.println("Staic method of the class ScaleneTriangle");
    }

}
